﻿using Microsoft.EntityFrameworkCore;
using RepositoryUnit.Repository.Interface;
using System.Threading.Tasks;

namespace RepositoryUnit.Repository.UnitOfWork
{
    public interface IUnitOfWork
    {
        /// <summary>
        /// 获得IRepository。
        /// </summary>
        /// <typeparam name="TEntity">实体。</typeparam>
        /// <returns>返回IRepository。</returns>
        IRepository<TEntity> GetRepository<TEntity>() where TEntity : class;

        /// <summary>
        /// 提交。
        /// </summary>
        /// <returns>修改数量。</returns>
        Task<int> SaveChangesAsync();
    }
}